/**
    Copyright (C) 2011  Alexander Vollmer

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.jefb.service;

import java.util.List;

import org.jefb.entity.CommonSearchCriteria;
import org.jefb.entity.IBasicEntity;


public interface ICommonPersistenceService {
	
	//<T,CC> Collection<CC> getLazyCollection(T entity, Class<CC> collectionClazz, String marker);

	<T> List<T> findAll(Class<T> clazz);
	<T> List<T> findAllByExample(T entity);
	<T> List<T> findByCriteria(T entity, CommonSearchCriteria commonSearchCriteria);
	<T> void persistEntity(T entity);
	<T extends IBasicEntity> void deleteEntity(T entity);
	<T> void updateEntity(T entity);
	<T> Long getTotalSizeByCriteria(T searchCriteria);
	<T> void refresh(T entity);
	void flush();
	<T> List<T> findByExample(T example, String... excudes);
	
}
